]> dgit.raspbian.org Git - gtk+3.0.git/commit
gtkwindow: Shuffle gdk_window_set_startup_id() calls
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 18 Jan 2023 20:01:00 +0000 (21:01 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Wed, 25 Jan 2023 10:22:40 +0000 (11:22 +0100)
commit2a470386353fb18229b16d74948195c88cf9ab01
tree849853cdcf31d0cd046fea62225e089ceb8c69d3
parent6ccd786a93a9309247abcdb3224cb874507d1a39
gtkwindow: Shuffle gdk_window_set_startup_id() calls

While this used to be tangential to windows showing or requesting
focus, the xdg-activation Wayland protocol does merge both concepts
together.

But also, for a correct interaction with the compositor, the
toolkit should ideally merge the activation request resulting from
both into the same one, so that the gdk_window_focus() request
replies to the startup token that started the application and
correct focus-stealing prevention/etc happens, instead making up
one just in time for the focus request.

This kind of requires doing things in the right order, a show()
request on the GtkWindow should activate any pending activation
token on the toplevel, a present() request should additionally
create a new token if there was none pending. And
xdg_activation_v1_activate() should happen once on both.

Shuffle the gdk_window_set_startup_id() calls so that this
happens in the right order for Wayland, while making X11 happy
too.

(cherry-picked from commit e8adfa2a889cd45ee0ce0727d7eae0a61fdb7dce)
gtk/gtkwindow.c